UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wFdHG+THHVHdXUXrDxYX7vQ8uB0fw9Rb/z0PSFD+MBI='
WHERE
key_id = '8e305390d41dec5c9b9abfda418d2057a286ccfd64b655d68403341019fb5e00'
AND (
token = 'wFdHG+THHVHdXUXrDxYX7vQ8uB0fw9Rb/z0PSFD+MBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)