UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NeSC+i9ik8K855icxA42G0fC9aT3DQMgbaBGCuu7Q60=' 
WHERE 
  key_id = 'e66e41577584572cbe4f15c57cf2b38e83b5a1d03a4c71d2c216f0b717ffce58' 
  AND (
    token = 'NeSC+i9ik8K855icxA42G0fC9aT3DQMgbaBGCuu7Q60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041