UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bw2BH2+8AE/2dtCJXSoRKPdlxpBcuIoMjZ5D560NN3U='
WHERE
key_id = '67444357cce461c4127e3c5388abcdbf0ae05e491749ed75bc54fe973db4d683'
AND (
token = 'Bw2BH2+8AE/2dtCJXSoRKPdlxpBcuIoMjZ5D560NN3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)