UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q7aIDNv0SvaBZ4D8HYNacAKMcUFot4f8P9dJzarZMVs='
WHERE
key_id = '888d60d6af5ef8579c5353b5259c450a85bb4ba34d2b8532cd71f73c67f580cc'
AND (
token = 'Q7aIDNv0SvaBZ4D8HYNacAKMcUFot4f8P9dJzarZMVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)