UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Me4t+0b4tJlplD+dnXxRwgn2L27C0yUp1A49lAXFjQg=' 
WHERE 
  key_id = '21a6eb0dfccfa75d407e3eae9450d288f8de3efce3d216da253a81c3deec0fd2' 
  AND (
    token = 'Me4t+0b4tJlplD+dnXxRwgn2L27C0yUp1A49lAXFjQg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032