UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YllXWUPptoFuMjAf04Vh+8Al8+MEuwjv5HhVciR9UBQ='
WHERE
key_id = 'ebe6ed9469a461823256dbac0594e4b93cd0751eca24190dc61f0ce343d41a2e'
AND (
token = 'YllXWUPptoFuMjAf04Vh+8Al8+MEuwjv5HhVciR9UBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)