UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NFJcvfAmMvaHSeflaAGtzlwaAYm0/8xnutb4qhqqUPs='
WHERE
key_id = '2d4650fe6155f68a5967ccb8fcb81ae69f406d60b264b200632e97e4e7b0e442'
AND (
token = 'NFJcvfAmMvaHSeflaAGtzlwaAYm0/8xnutb4qhqqUPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)