UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+mSGEcBmzITxK/0XzK6pbN5oLcNtkfZ7mb87WakQ4ss=' 
WHERE 
  key_id = '713c1b211ef1badf84db1499427b7d70f191c1415ee28141c19017ca2fd0ae9b' 
  AND (
    token = '+mSGEcBmzITxK/0XzK6pbN5oLcNtkfZ7mb87WakQ4ss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038