UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zg5jP5JgJUC9nXH5S6Qd5SGZf2wvi40HfONKWSrOX0E=' 
WHERE 
  key_id = '307be0e0b6335891d32f6076248316e85328ecc8b8b2e591a1e9bebdc084dd86' 
  AND (
    token = 'zg5jP5JgJUC9nXH5S6Qd5SGZf2wvi40HfONKWSrOX0E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024