UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fFe8xNKU7V+7sufDSZupRJ7fZ2uhow5gsJAIsb5JudM='
WHERE
key_id = '93f8fb4bfe1c34526303e5738f385d945901e8810ae982bd031c553af9cb4a18'
AND (
token = 'fFe8xNKU7V+7sufDSZupRJ7fZ2uhow5gsJAIsb5JudM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)