UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7aiCJiPmmEhU/GPWsqOlcR/FVFZDjIMUHtMCAvbDxqw=' 
WHERE 
  key_id = '7717d3029ae51b04b7c22c6147e711ca52c46fd61c622cf51835d69b3d87af8b' 
  AND (
    token = '7aiCJiPmmEhU/GPWsqOlcR/FVFZDjIMUHtMCAvbDxqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048