UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aHq0JtnYnq/RxqBPY9qAK0eTFHsZlE7uWar/qywouSE=' 
WHERE 
  key_id = 'b19a31846679fc27f9f3beed3143993e3fd7127bf5d577354351760fc48cd9c5' 
  AND (
    token = 'aHq0JtnYnq/RxqBPY9qAK0eTFHsZlE7uWar/qywouSE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040