UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WIR0N7ACDx/ffIdKBdfgAsO18eT+Ail2lTt+2HfZK+8='
WHERE
key_id = '4123df3db763d20871f70129cc6001dcc97e61b8b6bd432a43723dc3029babd6'
AND (
token = 'WIR0N7ACDx/ffIdKBdfgAsO18eT+Ail2lTt+2HfZK+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)