UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qdpx2PIINm/uo4OH6qyUuJiAGbiC5NNFquokiMDa23U='
WHERE
key_id = 'e64e4112cb85ab898736561abb234d47ec5e9af963b0259327e8ce5cf9cd0b56'
AND (
token = 'qdpx2PIINm/uo4OH6qyUuJiAGbiC5NNFquokiMDa23U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)