UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a0Axq/Or+pTxq28OO/NcajOTnOlJt7D0WV0jUHfqpdg='
WHERE
key_id = 'df4daf5857b28e00a41814feb8a0a6b82ee88e533bac2240ef5cb27793f6cb4d'
AND (
token = 'a0Axq/Or+pTxq28OO/NcajOTnOlJt7D0WV0jUHfqpdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)