UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z6np1Ni/Pfs8ntz8NGmh7ZWDmfLC5sLIUObw3zFmeZQ='
WHERE
key_id = '41d5bf27717d393ab1af2db702d763e77b661dc9bca35bf425f06a6acfc98ee9'
AND (
token = 'Z6np1Ni/Pfs8ntz8NGmh7ZWDmfLC5sLIUObw3zFmeZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)