UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BYRYxZ+DrUR0YauUMewVkDTc8VtCF0jnHowu9uvzx+k='
WHERE
key_id = 'ff757d1d2e15df5b8053e3c709d779bf29aab46d0719fb06a6b42a730bb388e5'
AND (
token = 'BYRYxZ+DrUR0YauUMewVkDTc8VtCF0jnHowu9uvzx+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)