UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u0XHLUzFtkBZdWOdJHXLTBXPXSKkLKEqIXgfY6pW9Do='
WHERE
key_id = 'b7256cce9760ae2f7d5f8333e980681c90e3357f0601903063bb304ce4e757b5'
AND (
token = 'u0XHLUzFtkBZdWOdJHXLTBXPXSKkLKEqIXgfY6pW9Do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)