UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8sOoaHFDWsJEpcrv9X3nx1CbFFhf/5eyy0dm5v2KROU='
WHERE
key_id = '0625af81acb3fc2e65053512cfac6b5ed0caa3da1cacbccd48573ee544d4409e'
AND (
token = '8sOoaHFDWsJEpcrv9X3nx1CbFFhf/5eyy0dm5v2KROU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)