UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DUit+q96e6Uz8o/u0Ne4Acke1NND4GK+8gjFvtyJJsc=' 
WHERE 
  key_id = '95eec15d140e256b02d6b3d128aaf43a5d11a6973abd31d1a79c00e155650d71' 
  AND (
    token = 'DUit+q96e6Uz8o/u0Ne4Acke1NND4GK+8gjFvtyJJsc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028