UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vK6EJyVQKET1fdgeJ2Ews+lO0iTvs5E/8AjhUI2KJRU='
WHERE
key_id = 'b0645955f4420b04f95d5cd335af1f61ef376fea45cbafeea85ac8a5dfd53a0a'
AND (
token = 'vK6EJyVQKET1fdgeJ2Ews+lO0iTvs5E/8AjhUI2KJRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)