UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bFMnn7munwKZ1Wk+HfEdE4TKErAW2CgN1/CV16RA37I='
WHERE
key_id = '54a746d3da730ea267e4a9987e9e383d0cf9d11772fb6ea1237bebf347801bab'
AND (
token = 'bFMnn7munwKZ1Wk+HfEdE4TKErAW2CgN1/CV16RA37I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)