UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FCscaIcvf71k7LpyQPVMoFUTw09c/E4vwy2KtBq90vc=' 
WHERE 
  key_id = 'e7e4759de8143bdbaf9c77114c577e8ca2d2ffa1338047bd6a1b054b3cc3c678' 
  AND (
    token = 'FCscaIcvf71k7LpyQPVMoFUTw09c/E4vwy2KtBq90vc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032