UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zn6wBWu5tmrqMs5pEORuOqpvppSUXiylTK/olUdC8lw=' 
WHERE 
  key_id = '17b36bb9e861c3ed190955fb68462b90d54c11098750276323ab35233f2446be' 
  AND (
    token = 'zn6wBWu5tmrqMs5pEORuOqpvppSUXiylTK/olUdC8lw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017