UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '08KKYHkFfCTNMJeDDGpPOfsSgD8sl/q5sNH9IF1AFN0='
WHERE
key_id = '4a57b7b9feb255a5b99308a4664144894b40790f8da2634c1e9c251abb58d510'
AND (
token = '08KKYHkFfCTNMJeDDGpPOfsSgD8sl/q5sNH9IF1AFN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)