UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tmvjqLqLMYrT8tF/SGKXpOb3oNOuygyt7nLwQdaFDvM='
WHERE
key_id = '55e2cd083f3aa035106673e59355efdcec118c12930bc4c469c324644a08f833'
AND (
token = 'tmvjqLqLMYrT8tF/SGKXpOb3oNOuygyt7nLwQdaFDvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)