UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5LGnv/11QSp11xm33Q9ijXQe5igW/dBtHVAmNPEeD+0=' 
WHERE 
  key_id = 'e0e07b3f33628c87164ced169ae66fd09974bbf3a5f380e45f6d4b08cb5af313' 
  AND (
    token = '5LGnv/11QSp11xm33Q9ijXQe5igW/dBtHVAmNPEeD+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039