UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't5/h5QHebswdKORn7Uet3/1wRFgJ0THViORPxCW3Ki4=' 
WHERE 
  key_id = 'aae3642fc33cf44c0837697f72fbacb4ec9b36145cb06bac39a204b825a6d06f' 
  AND (
    token = 't5/h5QHebswdKORn7Uet3/1wRFgJ0THViORPxCW3Ki4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032