UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yuaz6MeGqmzjbwF3Zsyva8NpKGhukyfrPSj37r2ftEY='
WHERE
key_id = '5e8cd9f2f0e31e1d9e1c653f5699db7f05b270e3aa53042f787773e3c18af31b'
AND (
token = 'yuaz6MeGqmzjbwF3Zsyva8NpKGhukyfrPSj37r2ftEY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)