UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VYteoIqHUBa0XF1aMs3HXc0KLkJS8AxigU7hPInkawo='
WHERE
key_id = '5e47f6259488580ad1973cf5601369d49addc2b507dae91c363b2fb642fbedb1'
AND (
token = 'VYteoIqHUBa0XF1aMs3HXc0KLkJS8AxigU7hPInkawo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)